import { DOUBLE_STATUS } from '@/enum/common';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';
import { Dictionary } from './dictionary.entity';

/**
 * 词汇表
 */
@Entity('dictionary_words')
export class DictionaryWords extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'dictionary_id',
    comment: `词典id`,
  })
  dictionaryId: number;

  dictionaryInfo: Dictionary;

  @Column({
    type: 'varchar',
    name: 'word_content',
    comment: `单词内容`,
  })
  wordContent: string;

  @Column({
    type: 'text',
    name: 'word_pronunciation',
    comment: `单词发音`,
  })
  wordPronunciation: string;

  @Column({
    type: 'text',
    name: 'word_translate',
    comment: `翻译`,
  })
  wordTranslate: string;

  /**
   * 收藏状态
   */
  collectionStatus: DOUBLE_STATUS;
}
